//------------------------------------------------------------------------------
// <copyright file="TestHooks.h.h" company="Microsoft">
//     Copyright (c) Microsoft Corporation.  All rights reserved.
// </copyright>
//------------------------------------------------------------------------------

#pragma once

#include "Player.h"
using namespace Microsoft::Internal::GamesTest::Rpc::Server;

typedef int RpcHookCode;

namespace CppDemo {
	public ref class TestHooks sealed
	{
	public:
		TestHooks(void);

		void Initialize(int port);
		void StartProcessPendingRequests();
		void Shutdown();

	private:
		static RpcHookCode OutputNoInput(RpcArchive^ input, RpcArchive^ output);
		static RpcHookCode InputNoOutput(RpcArchive^ input, RpcArchive^ output);
		static RpcHookCode InputOutput(RpcArchive^ input, RpcArchive^ output);
		static RpcHookCode NoInputNoOutput(RpcArchive^ input, RpcArchive^ output);
		static RpcHookCode MultiInputMultiOutput(RpcArchive^ input, RpcArchive^ output);
		static RpcHookCode HookTimesOut(RpcArchive^ input, RpcArchive^ output);
		static RpcHookCode HookWaitTenSeconds(RpcArchive^ input, RpcArchive^ output);
		static RpcHookCode ReturnLargeNumberOfValues(RpcArchive^ input, RpcArchive^ output);
		static RpcHookCode ReturnErrorCode(RpcArchive^ input, RpcArchive^ output);
		static RpcHookCode SimultaneousHookCalls(RpcArchive^ input, RpcArchive^ output);
		static RpcHookCode LargeNumberOfInputValues(RpcArchive^ input, RpcArchive^ output);
		static RpcHookCode StopTheServer(RpcArchive^ input, RpcArchive^ output);
		static RpcHookCode InputOutputSubtraction(RpcArchive^ input, RpcArchive^ output);
		static RpcHookCode EchoStrings(RpcArchive^ input, RpcArchive^ output);
		static RpcHookCode RetrieveMissingRpcArchiveField(RpcArchive^ input, RpcArchive^ output);
		static RpcHookCode RpcArchiveValueIsNull(RpcArchive^ input, RpcArchive^ output);
		static RpcHookCode CallProcessPendingRequestsOnceOnServer3 (RpcArchive^ input, RpcArchive^ output);
		static RpcHookCode HookOrderIncrementNoOutput(RpcArchive^ input, RpcArchive^ output);
		static RpcHookCode GetHookOrderCounter(RpcArchive^ input, RpcArchive^ output);
		static RpcHookCode InputOutputIntCollection(RpcArchive^ input, RpcArchive^ output);
		static RpcHookCode InputOutputInt64Collection(RpcArchive^ input, RpcArchive^ output);
		static RpcHookCode InputOutputFloatCollection(RpcArchive^ input, RpcArchive^ output);
		static RpcHookCode InputOutputStringCollection(RpcArchive^ input, RpcArchive^ output);
		static RpcHookCode InputOutputIntCollectionAndIntNumber(RpcArchive^ input, RpcArchive^ output);
		static RpcHookCode InputOutputMultipleCollections(RpcArchive^ input, RpcArchive^ output);
		static RpcHookCode TriggerEvent(RpcArchive^ eventName, RpcArchive^ eventParameter);
		static RpcHookCode AddArchiveToArchive(RpcArchive^ input, RpcArchive^ output);
		static RpcHookCode AddArchiveToArchiveWithIntColl(RpcArchive^ input, RpcArchive^ output);
		static RpcHookCode AddArchiveToArchiveWithStringColl(RpcArchive^ input, RpcArchive^ output);
		static RpcHookCode AddArchiveToArchiveWithInt64Coll(RpcArchive^ input, RpcArchive^ output);
		static RpcHookCode InputOutputArchiveCollectionToArchive(RpcArchive^ input, RpcArchive^ output);
		static RpcHookCode InputOutputArchiveCollectionToArchiveCollections(RpcArchive^ input, RpcArchive^ output);
		static RpcHookCode InputRpcArchiveToAnotherRpcArchiveForLoad(RpcArchive^ input, RpcArchive^ output);
		static RpcHookCode InputRpcArchiveToAnotherRpcArchiveCollectionForLoad(RpcArchive^ input, RpcArchive^ output);
		static RpcHookCode InputOutputMultipleCollectionsForRpcArchive(RpcArchive^ input, RpcArchive^ output);
		static RpcHookCode ThrowException(RpcArchive^ input, RpcArchive^ output);
		static RpcHookCode InputPlayerNoOutput(RpcArchive^ input, RpcArchive^ output);
		static RpcHookCode NoInputPlayerOutput(RpcArchive^ input, RpcArchive^ output);
		static RpcHookCode InputPlayerOutputPlayer(RpcArchive^ input, RpcArchive^ output);
		static RpcHookCode AddBinaryDataToArchive(RpcArchive^ input, RpcArchive^ output);
		static RpcHookCode AddBinaryDataCollectionToArchive(RpcArchive^ input, RpcArchive^ output);
		static RpcHookCode NoInputBinaryDataOutput(RpcArchive^ input, RpcArchive^ output);
		static RpcHookCode EchoBinary(RpcArchive^ input, RpcArchive^ output);
		static RpcHookCode StartServerWithQueueSize(RpcArchive^ input, RpcArchive^ output);
		static RpcHookCode StopServerWithQueueSize(RpcArchive^ input, RpcArchive^ output);
		static RpcHookCode RunServerWithQueueSize(RpcArchive^ input, RpcArchive^ output);

		static RpcHookCode VerifyIncomingPlayerData(Player^ playerData);

		void ProcessPendingRequests();

		Windows::System::Threading::ThreadPoolTimer^ m_ProcessTimer;
	};
};